package com.houtai.controller.course.collection;


import com.houtai.authority.Authority;
import com.houtai.authority.AuthorityType;
import com.houtai.bean.dto.course.PageCoureId;
import com.houtai.service.course.collection.CourseCollectionService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * Created by lizhun on 2017/7/19.
 */
@Controller
@RequestMapping(value = {"v5"})
public class CourseCollectionController {
    @Resource
    private CourseCollectionService courseCollectionService;
    /**
     * @Purpose  分页加载在线课程收藏列表
     * @version  1.0
     * @author   lizhun
     * @param    request
     * @return   RetInfo
     */
    @RequestMapping(value="/course/collection/list")
    @Authority(AuthorityType.Login)
    public ModelAndView collection(HttpServletRequest request, PageCoureId page){
        ModelAndView mv = new ModelAndView("course/collection/list");
        mv.addObject("retInfo", courseCollectionService.findTdCourseCollectionList(page, request));
        mv.addObject("token", request.getParameter("token"));
        return mv;
    }

}
